package com.empire.module.member.dal.mysql.warninggather;

import com.empire.framework.common.pojo.PageResult;
import com.empire.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.empire.framework.mybatis.core.mapper.BaseMapperX;
import com.empire.module.member.dal.dataobject.warninggather.WarningGatherDO;
import org.apache.ibatis.annotations.Mapper;
import com.empire.module.member.controller.admin.warninggather.vo.*;

/**
 * 聚集预警主表（1条记录对应1次聚集事件） Mapper
 *
 * @author 主席大人
 */
@Mapper
public interface WarningGatherMapper extends BaseMapperX<WarningGatherDO> {

    default PageResult<WarningGatherDO> selectPage(WarningGatherPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<WarningGatherDO>()
                .eqIfPresent(WarningGatherDO::getConfigId, reqVO.getConfigId())
                .likeIfPresent(WarningGatherDO::getGatherName, reqVO.getGatherName())
                .inIfPresent(WarningGatherDO::getId, reqVO.getGatherIdList())
                .orderByDesc(WarningGatherDO::getId));
    }

}